<?php
/**
 * Purpose:
 * 新文件
 * File Name:
 * Icons.php
 * Author:
 * 武当山道士<912900700@qq.com>
 * Create:
 * 2019/9/29 19:12
 */

namespace app\api\model;

use think\Db;

class Icon extends Base
{

    /**
     * @param int $type : 默认1=首页标签, 2=订单标签, 10=其他
     * @return mixed
     * @throws
     */
    public function getIconsByType($type=1)
    {
        $list = Db::name('icon')
            ->field("id, name, CONCAT('$this->siteUrl',on_image) as icon_on, 
            CONCAT('$this->siteUrl',off_image) as icon_off")
            ->where([ 'type'=>$type ])
            ->select();
        return $list ? : null;
    }
}